<template>
	<div id="list">
		<h2>最新推荐</h2>
		<el-row>
			<h3><i class="iconfont">&#xe615;</i>预估价 150000-5000000元</h3>
			<ul>
				<li v-for="list in assetsList">
					<a href=""><span>{{ list.date.substr(0,10) }}<em>{{ list.title | limitBy('4') }}</em></span>预估价 {{ list.price}}元</a>
				</li>
			</ul>
		</el-row>
	</div>
</template>
<script>
	export default{
		name: "list",
		data(){
			return {
                assetsList:[]
			}
		},
		props: ['assetsType'],
        mounted: function () {
			this.getList()
		},
		computed: {
			newlist(){
			//	return this.assetsList.slice(0,3);
			}
		},
		methods:{
			getList() {
            	const _this = this;
				this.axios.get(_this.$store.state.Check.url + '/get_products',{
					params: {
						slug : localStorage.slug,
						list_name : 'featured_products',
						type : this.assetsType ,
					}
				}).then(function(response){
					_this.assetsList = response.data;
					console.log(_this.assetsList.length);
				}).catch(err => {
                    this.$notify({
                        title: '警告',
                        message: '网络出错了~再试试吧~',
                        type: 'warning'
                    });
                });
            }
		}
	}
</script>
<style lang="less" rel="stylesheet/less" type="text/css">
	@import '../../../public/css/variable.less';
	#list{
	h2{
		.fonts(18px);
	    color: #5d5f63;
	    margin-bottom: 15px;
	}
	.el-row{
		height: 355px;
		overflow:hidden;
		width: 288px;
        border: 1px solid #f5f5f5;
        box-sizing: border-box;
        .bdr(5px);
	}
	h3{
		.fonts(16px);
		color: @cgolden;
		padding: 15px 20px;
		border-bottom: 1px solid #f5f5f5;
		i{ padding-right: 5px; }
    }
    ul{
        height: 390px;
        li{
            .fonts(14px);
            color: #8f9397;
            padding: 20px 0;
            border-bottom: 1px dashed #ebebeb;
            margin: 0 25px 0 30px;
            span{
                position: relative;
                display: block;
                color: #5D5F63;
                .fonts(16px);
                line-height: 14px;
                margin-bottom: 12px;
                em{ padding-left: 15px; }
                &:before{
                    content: "";
                    position: absolute;
                    left: -8px;
                    display: inline-block;
                    height: 14px;
                    width: 3px;
                    background: @cgolden;
                }
            }
        }
    }
    }
</style>